Skip to main content
Notice removed Reward existing answer by Ionică Bizău
Bounty Ended with Rahil Wazir's answer chosen by Ionică Bizău
Notice added Reward existing answer by Ionică Bizău
Bounty Started worth 50 reputation by Ionică Bizău
added 1295 characters in body
Source Link
Ionică Bizău
  • 321
  • 3
  • 4
  • 20

I want to serve a specific Wordpress page for multiple urls. Basically I want to point all the urls in a specific format to a known page:

/some-prefix-* => /target-page

And accessing /some-prefix-and-here-something it should load /target-page.

How to do this?

Note I do not want to redirect the user but to be able to serve an existing page to multiple urls.

The .htaccess looks like this:

# BEGIN s2Member GZIP exclusions
RewriteEngine On RewriteRule ^prefix-*$ some/path/to/directory-$1 [NC,L]
<IfModule rewrite_module>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{QUERY_STRING} (^|\?|&)s2member_file_download\=.+ [OR]
    RewriteCond %{QUERY_STRING} (^|\?|&)no-gzip\=1
    RewriteRule .* - [E=no-gzip:1]
</IfModule>
# END s2Member GZIP exclusions

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

DirectoryIndex index.php index.html

I thought by adding RewriteEngine On RewriteRule ^prefix-*$ some/path/to/directory-$1 [NC,L] will serve /prefix-* from some/path/to/directory-$1. For example: when accessing example.com/prefix-foo should be the same with example.com/some/path/to/directory-foo (which resolves to example.com/some/path/to/directory-foo/index.html).

Also, if there is already a Wordpress page with the name prefix-bar, /prefix-bar should not load example.com/some/path/to/directory-bar/index.html.

I want to serve a specific Wordpress page for multiple urls. Basically I want to point all the urls in a specific format to a known page:

/some-prefix-* => /target-page

And accessing /some-prefix-and-here-something it should load /target-page.

How to do this?

Note I do not want to redirect the user but to be able to serve an existing page to multiple urls.

I want to serve a specific Wordpress page for multiple urls. Basically I want to point all the urls in a specific format to a known page:

/some-prefix-* => /target-page

And accessing /some-prefix-and-here-something it should load /target-page.

How to do this?

Note I do not want to redirect the user but to be able to serve an existing page to multiple urls.

The .htaccess looks like this:

# BEGIN s2Member GZIP exclusions
RewriteEngine On RewriteRule ^prefix-*$ some/path/to/directory-$1 [NC,L]
<IfModule rewrite_module>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{QUERY_STRING} (^|\?|&)s2member_file_download\=.+ [OR]
    RewriteCond %{QUERY_STRING} (^|\?|&)no-gzip\=1
    RewriteRule .* - [E=no-gzip:1]
</IfModule>
# END s2Member GZIP exclusions

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

DirectoryIndex index.php index.html

I thought by adding RewriteEngine On RewriteRule ^prefix-*$ some/path/to/directory-$1 [NC,L] will serve /prefix-* from some/path/to/directory-$1. For example: when accessing example.com/prefix-foo should be the same with example.com/some/path/to/directory-foo (which resolves to example.com/some/path/to/directory-foo/index.html).

Also, if there is already a Wordpress page with the name prefix-bar, /prefix-bar should not load example.com/some/path/to/directory-bar/index.html.

Tweeted twitter.com/StackWordPress/status/682137817061916672
added 104 characters in body
Source Link
Ionică Bizău
  • 321
  • 3
  • 4
  • 20

I want to serve a specific Wordpress page for multiple urls. Basically I want to point all the urls in a specific format to a known page:

/some-prefix-* => /target-page

And accessing /some-prefix-and-here-something it should load /target-page.

How to do this?

Note I do not want to redirect the user but to be able to serve an existing page to multiple urls.

I want to serve a specific Wordpress page for multiple urls. Basically I want to point all the urls in a specific format to a known page:

/some-prefix-* => /target-page

And accessing /some-prefix-and-here-something it should load /target-page.

How to do this?

I want to serve a specific Wordpress page for multiple urls. Basically I want to point all the urls in a specific format to a known page:

/some-prefix-* => /target-page

And accessing /some-prefix-and-here-something it should load /target-page.

How to do this?

Note I do not want to redirect the user but to be able to serve an existing page to multiple urls.

deleted 45 characters in body
Source Link
Pieter Goosen
  • 55.4k
  • 23
  • 115
  • 209

I want to serve a specific Wordpress page for multiple urls. Basically I want to point all the urls in a specific format to a known page:

/some-prefix-* => /target-page

And accessing /some-prefix-and-here-something it should load /target-page.

How to do this? Or maybe is there a plugin for that already?

I want to serve a specific Wordpress page for multiple urls. Basically I want to point all the urls in a specific format to a known page:

/some-prefix-* => /target-page

And accessing /some-prefix-and-here-something it should load /target-page.

How to do this? Or maybe is there a plugin for that already?

I want to serve a specific Wordpress page for multiple urls. Basically I want to point all the urls in a specific format to a known page:

/some-prefix-* => /target-page

And accessing /some-prefix-and-here-something it should load /target-page.

How to do this?

Source Link
Ionică Bizău
  • 321
  • 3
  • 4
  • 20
Loading