Skip to main content
Tweeted twitter.com/#!/StackWebmasters/status/336569565595185155
deleted 1 characters in body
Source Link

Hello and thanks to all who contribute to this seemingly mind boggling puzzle. I apologize in advance if .htaccess questions belong on server fault.

So I have to move a domain to our hosting servers, this domain will be redirected to another existing website. We need to redirect the individual pages to their respective pages on the existing website for user friendliness and SEO purposes. The URL pattern of the website being redirected are:

domain.com/index.php?/Page.html

I have found a lot of information in regards to redirecting strings with question marks, but none seem to work and I believe it's because of the / after the ?.

The following is the last RewriteRule I've tried:

RewriteCond %{REQUEST_URI}  ^/index.php$
RewriteCond %{QUERY_STRING} ^/(.*).html$
RewriteRule ^(.*)$ http://www.cbdecksdomain.com/index/%1.html [R=301,L]

If I go to domain.com/index.php?/News.html the RewriteRule above results in the following:

domain.com/index/News.html?/News.html

I've also previously tried a rewrite from Drupal's site dealing with their nodes queries, but edited for the site I'm working on:

RewriteCond %{QUERY_STRING} ^/(.+)$
RewriteRule ^(.*)$ http://www.domain.com/index.php?/%1 [R=301,L]
RewriteRule ^/*(.*)$ http://www.domain.com/index/$1 [R=301,L]

The above results in a redirect loop. If I can at least get the URL to rewrite to a path with no question marks, I could then do individual redirects for the pages of the site.

Any help in getting rid of the question mark in this situation would be extremely appreciated.

EDIT:
Ultimately, I will be redirecting from one website to another. The websites don't have the same naming conventions, so I imagine I'll use redirect 301 path new URL for the individual pages.

An example of the start to finish, I would need to redirect the following URL:

http://www.domain.com/index.php?/About.html

to:

http://www.newsite.com/about.html

Not all of the old site names will be the same as you see About.html matching about.html, there will be URLs with News.html going to /Blog-Folder/.

What I imagine would be most efficient is getting the /index.php?/Page.html redirected to a folder path on the initial website so that it is set up like:

domain.com/index.php?/About.html -> domain.com/index/About.html -> newsite.com/about.html

Feel free to ask for more clarification if needed, I greatly appreciate any and all help.

Hello and thanks to all who contribute to this seemingly mind boggling puzzle. I apologize in advance if .htaccess questions belong on server fault.

So I have to move a domain to our hosting servers, this domain will be redirected to another existing website. We need to redirect the individual pages to their respective pages on the existing website for user friendliness and SEO purposes. The URL pattern of the website being redirected are:

domain.com/index.php?/Page.html

I have found a lot of information in regards to redirecting strings with question marks, but none seem to work and I believe it's because of the / after the ?.

The following is the last RewriteRule I've tried:

RewriteCond %{REQUEST_URI}  ^/index.php$
RewriteCond %{QUERY_STRING} ^/(.*).html$
RewriteRule ^(.*)$ http://www.cbdecks.com/index/%1.html [R=301,L]

If I go to domain.com/index.php?/News.html the RewriteRule above results in the following:

domain.com/index/News.html?/News.html

I've also previously tried a rewrite from Drupal's site dealing with their nodes queries, but edited for the site I'm working on:

RewriteCond %{QUERY_STRING} ^/(.+)$
RewriteRule ^(.*)$ http://www.domain.com/index.php?/%1 [R=301,L]
RewriteRule ^/*(.*)$ http://www.domain.com/index/$1 [R=301,L]

The above results in a redirect loop. If I can at least get the URL to rewrite to a path with no question marks, I could then do individual redirects for the pages of the site.

Any help in getting rid of the question mark in this situation would be extremely appreciated.

EDIT:
Ultimately, I will be redirecting from one website to another. The websites don't have the same naming conventions, so I imagine I'll use redirect 301 path new URL for the individual pages.

An example of the start to finish, I would need to redirect the following URL:

http://www.domain.com/index.php?/About.html

to:

http://www.newsite.com/about.html

Not all of the old site names will be the same as you see About.html matching about.html, there will be URLs with News.html going to /Blog-Folder/.

What I imagine would be most efficient is getting the /index.php?/Page.html redirected to a folder path on the initial website so that it is set up like:

domain.com/index.php?/About.html -> domain.com/index/About.html -> newsite.com/about.html

Feel free to ask for more clarification if needed, I greatly appreciate any and all help.

Hello and thanks to all who contribute to this seemingly mind boggling puzzle. I apologize in advance if .htaccess questions belong on server fault.

So I have to move a domain to our hosting servers, this domain will be redirected to another existing website. We need to redirect the individual pages to their respective pages on the existing website for user friendliness and SEO purposes. The URL pattern of the website being redirected are:

domain.com/index.php?/Page.html

I have found a lot of information in regards to redirecting strings with question marks, but none seem to work and I believe it's because of the / after the ?.

The following is the last RewriteRule I've tried:

RewriteCond %{REQUEST_URI}  ^/index.php$
RewriteCond %{QUERY_STRING} ^/(.*).html$
RewriteRule ^(.*)$ http://www.domain.com/index/%1.html [R=301,L]

If I go to domain.com/index.php?/News.html the RewriteRule above results in the following:

domain.com/index/News.html?/News.html

I've also previously tried a rewrite from Drupal's site dealing with their nodes queries, but edited for the site I'm working on:

RewriteCond %{QUERY_STRING} ^/(.+)$
RewriteRule ^(.*)$ http://www.domain.com/index.php?/%1 [R=301,L]
RewriteRule ^/*(.*)$ http://www.domain.com/index/$1 [R=301,L]

The above results in a redirect loop. If I can at least get the URL to rewrite to a path with no question marks, I could then do individual redirects for the pages of the site.

Any help in getting rid of the question mark in this situation would be extremely appreciated.

EDIT:
Ultimately, I will be redirecting from one website to another. The websites don't have the same naming conventions, so I imagine I'll use redirect 301 path new URL for the individual pages.

An example of the start to finish, I would need to redirect the following URL:

http://www.domain.com/index.php?/About.html

to:

http://www.newsite.com/about.html

Not all of the old site names will be the same as you see About.html matching about.html, there will be URLs with News.html going to /Blog-Folder/.

What I imagine would be most efficient is getting the /index.php?/Page.html redirected to a folder path on the initial website so that it is set up like:

domain.com/index.php?/About.html -> domain.com/index/About.html -> newsite.com/about.html

Feel free to ask for more clarification if needed, I greatly appreciate any and all help.

Formatting
Source Link
Zistoloen
  • 10k
  • 6
  • 36
  • 59

How do I redirect a URL using Rewriterewrite in .htaccess that has a question mark and forward slash where page.html is the variable?

Hello and thanks to all who contribute to this seemingly mind boggling puzzle. I apologize in advance if .htaccess.htaccess questions belong on server fault.

So I have to move a domain to our hosting servers, this domain will be redirected to another existing website. We need to redirect the individual pages to their respective pages on the existing website for User Friendlinessuser friendliness and SEO purposes. The URL pattern of the website being redirected are:

domain.com/index.php?/Page.html

I have found a lot of information in regards to redirecting strings with question marks, but none seem to work and I believe it's because of the // after the ??.

The following is the last RewriteRuleRewriteRule I've tried:

RewriteCond %{REQUEST_URI}  ^/index.php$
RewriteCond %{QUERY_STRING} ^/(.*).html$
RewriteRule ^(.*)$ http://www.cbdecks.com/index/%1.html [R=301,L]

If I go to domain.com/index.php?/News.html the RewriteRuleRewriteRule above results in the following:

domain.com/index/News.html?/News.html

I've also previously tried a Rewriterewrite from drupal'sDrupal's site dealing with their nodes queries, but edited for the site I'm working on:

RewriteCond %{QUERY_STRING} ^/(.+)$
RewriteRule ^(.*)$ http://www.domain.com/index.php?/%1 [R=301,L]
 
RewriteRule ^/*(.*)$ http://www.domain.com/index/$1 [R=301,L]

The above results in a redirect loop. If I can at least get the URL to rewrite to a path with no question marks, I could then do individual redirects for the pages of the site.

Any help in getting rid of the question mark in this situation would be extremely appreciated.

--EDIT--EDIT:
Ultimately, I will be redirecting from one website to another. The websites don't have the same naming conventions, so I imagine I'll use redirect 301 path newurlredirect 301 path new URL for the individual pages.

An example of the start to finish, I would need to redirect the following urlURL:

http://www.domain.com/index.php?/About.html

to:

http://www.newsite.com/about.html

Not all of the old site names will be the same as you see About.htmlAbout.html matching about.htmlabout.html, there will be urlsURLs with News.htmlNews.html going to /Blog-Folder//Blog-Folder/.

What I imagine would be most efficient is getting the /index.php?/Page.html/index.php?/Page.html redirected to a folder path on the initial website so that it is set up like:

domain.com/index.php?/About.html -> domain.com/index/About.html -> newsite.com/about.html

Feel free to ask for more clarification if needed, I greatly appreciate any and all help.

How do I redirect a URL using Rewrite in .htaccess that has a question mark and forward slash where page.html is the variable?

Hello and thanks to all who contribute to this seemingly mind boggling puzzle. I apologize in advance if .htaccess questions belong on server fault.

So I have to move a domain to our hosting servers, this domain will be redirected to another existing website. We need to redirect the individual pages to their respective pages on the existing website for User Friendliness and SEO purposes. The URL pattern of the website being redirected are:

domain.com/index.php?/Page.html

I have found a lot of information in regards to redirecting strings with question marks, but none seem to work and I believe it's because of the / after the ?

The following is the last RewriteRule I've tried:

RewriteCond %{REQUEST_URI}  ^/index.php$
RewriteCond %{QUERY_STRING} ^/(.*).html$
RewriteRule ^(.*)$ http://www.cbdecks.com/index/%1.html [R=301,L]

If I go to domain.com/index.php?/News.html the RewriteRule above results in the following:

domain.com/index/News.html?/News.html

I've also previously tried a Rewrite from drupal's site dealing with their nodes queries, but edited for the site I'm working on:

RewriteCond %{QUERY_STRING} ^/(.+)$
RewriteRule ^(.*)$ http://www.domain.com/index.php?/%1 [R=301,L]
 
RewriteRule ^/*(.*)$ http://www.domain.com/index/$1 [R=301,L]

The above results in a redirect loop. If I can at least get the URL to rewrite to a path with no question marks, I could then do individual redirects for the pages of the site.

Any help in getting rid of the question mark in this situation would be extremely appreciated.

--EDIT-- Ultimately, I will be redirecting from one website to another. The websites don't have the same naming conventions, so I imagine I'll use redirect 301 path newurl for the individual pages.

An example of the start to finish, I would need to redirect the following url:

http://www.domain.com/index.php?/About.html

to:

http://www.newsite.com/about.html

Not all of the old site names will be the same as you see About.html matching about.html, there will be urls with News.html going to /Blog-Folder/

What I imagine would be most efficient is getting the /index.php?/Page.html redirected to a folder path on the initial website so that it is set up like:

domain.com/index.php?/About.html -> domain.com/index/About.html -> newsite.com/about.html

Feel free to ask for more clarification if needed, I greatly appreciate any and all help.

How do I redirect a URL using rewrite in .htaccess that has a question mark and forward slash where page.html is the variable?

Hello and thanks to all who contribute to this seemingly mind boggling puzzle. I apologize in advance if .htaccess questions belong on server fault.

So I have to move a domain to our hosting servers, this domain will be redirected to another existing website. We need to redirect the individual pages to their respective pages on the existing website for user friendliness and SEO purposes. The URL pattern of the website being redirected are:

domain.com/index.php?/Page.html

I have found a lot of information in regards to redirecting strings with question marks, but none seem to work and I believe it's because of the / after the ?.

The following is the last RewriteRule I've tried:

RewriteCond %{REQUEST_URI}  ^/index.php$
RewriteCond %{QUERY_STRING} ^/(.*).html$
RewriteRule ^(.*)$ http://www.cbdecks.com/index/%1.html [R=301,L]

If I go to domain.com/index.php?/News.html the RewriteRule above results in the following:

domain.com/index/News.html?/News.html

I've also previously tried a rewrite from Drupal's site dealing with their nodes queries, but edited for the site I'm working on:

RewriteCond %{QUERY_STRING} ^/(.+)$
RewriteRule ^(.*)$ http://www.domain.com/index.php?/%1 [R=301,L]
RewriteRule ^/*(.*)$ http://www.domain.com/index/$1 [R=301,L]

The above results in a redirect loop. If I can at least get the URL to rewrite to a path with no question marks, I could then do individual redirects for the pages of the site.

Any help in getting rid of the question mark in this situation would be extremely appreciated.

EDIT:
Ultimately, I will be redirecting from one website to another. The websites don't have the same naming conventions, so I imagine I'll use redirect 301 path new URL for the individual pages.

An example of the start to finish, I would need to redirect the following URL:

http://www.domain.com/index.php?/About.html

to:

http://www.newsite.com/about.html

Not all of the old site names will be the same as you see About.html matching about.html, there will be URLs with News.html going to /Blog-Folder/.

What I imagine would be most efficient is getting the /index.php?/Page.html redirected to a folder path on the initial website so that it is set up like:

domain.com/index.php?/About.html -> domain.com/index/About.html -> newsite.com/about.html

Feel free to ask for more clarification if needed, I greatly appreciate any and all help.

Clarifying a beginning URL type that is being redirected, and the URLs being redirected to.
Source Link

Hello and thanks to all who contribute to this seemingly mind boggling puzzle. I apologize in advance if .htaccess questions belong on server fault.

So I have to move a domain to our hosting servers, this domain will be redirected to another existing website. We need to redirect the individual pages to their respective pages on the existing website for User Friendliness and SEO purposes. The URL pattern of the website being redirected are:

domain.com/index.php?/Page.html

I have found a lot of information in regards to redirecting strings with question marks, but none seem to work and I believe it's because of the / after the ?

The following is the last RewriteRule I've tried:

RewriteCond %{REQUEST_URI}  ^/index.php$
RewriteCond %{QUERY_STRING} ^/(.*).html$
RewriteRule ^(.*)$ http://www.cbdecks.com/index/%1.html [R=301,L]

If I go to domain.com/index.php?/News.html the RewriteRule above results in the following:

domain.com/index/News.html?/News.html

I've also previously tried a Rewrite from drupal's site dealing with their nodes queries, but edited for the site I'm working on:

RewriteCond %{QUERY_STRING} ^/(.+)$
RewriteRule ^(.*)$ http://www.domain.com/index.php?/%1 [R=301,L]

RewriteRule ^/*(.*)$ http://www.domain.com/index/$1 [R=301,L]

The above results in a redirect loop. If I can at least get the URL to rewrite to a path with no question marks, I could then do individual redirects for the pages of the site.

Any help in getting rid of the question mark in this situation would be extremely appreciated.

--EDIT-- Ultimately, I will be redirecting from one website to another. The websites don't have the same naming conventions, so I imagine I'll use redirect 301 path newurl for the individual pages.

An example of the start to finish, I would need to redirect the following url:

http://www.domain.com/index.php?/About.html

to:

http://www.newsite.com/about.html

Not all of the old site names will be the same as you see About.html matching about.html, there will be urls with News.html going to /Blog-Folder/

What I imagine would be most efficient is getting the /index.php?/Page.html redirected to a folder path on the initial website so that it is set up like:

domain.com/index.php?/About.html -> domain.com/index/About.html -> newsite.com/about.html

Feel free to ask for more clarification if needed, I greatly appreciate any and all help.

Hello and thanks to all who contribute to this seemingly mind boggling puzzle. I apologize in advance if .htaccess questions belong on server fault.

So I have to move a domain to our hosting servers, this domain will be redirected to another existing website. We need to redirect the individual pages to their respective pages on the existing website for User Friendliness and SEO purposes. The URL pattern of the website being redirected are:

domain.com/index.php?/Page.html

I have found a lot of information in regards to redirecting strings with question marks, but none seem to work and I believe it's because of the / after the ?

The following is the last RewriteRule I've tried:

RewriteCond %{REQUEST_URI}  ^/index.php$
RewriteCond %{QUERY_STRING} ^/(.*).html$
RewriteRule ^(.*)$ http://www.cbdecks.com/index/%1.html [R=301,L]

If I go to domain.com/index.php?/News.html the RewriteRule above results in the following:

domain.com/index/News.html?/News.html

I've also previously tried a Rewrite from drupal's site dealing with their nodes queries, but edited for the site I'm working on:

RewriteCond %{QUERY_STRING} ^/(.+)$
RewriteRule ^(.*)$ http://www.domain.com/index.php?/%1 [R=301,L]

RewriteRule ^/*(.*)$ http://www.domain.com/index/$1 [R=301,L]

The above results in a redirect loop. If I can at least get the URL to rewrite to a path with no question marks, I could then do individual redirects for the pages of the site.

Any help in getting rid of the question mark in this situation would be extremely appreciated.

Hello and thanks to all who contribute to this seemingly mind boggling puzzle. I apologize in advance if .htaccess questions belong on server fault.

So I have to move a domain to our hosting servers, this domain will be redirected to another existing website. We need to redirect the individual pages to their respective pages on the existing website for User Friendliness and SEO purposes. The URL pattern of the website being redirected are:

domain.com/index.php?/Page.html

I have found a lot of information in regards to redirecting strings with question marks, but none seem to work and I believe it's because of the / after the ?

The following is the last RewriteRule I've tried:

RewriteCond %{REQUEST_URI}  ^/index.php$
RewriteCond %{QUERY_STRING} ^/(.*).html$
RewriteRule ^(.*)$ http://www.cbdecks.com/index/%1.html [R=301,L]

If I go to domain.com/index.php?/News.html the RewriteRule above results in the following:

domain.com/index/News.html?/News.html

I've also previously tried a Rewrite from drupal's site dealing with their nodes queries, but edited for the site I'm working on:

RewriteCond %{QUERY_STRING} ^/(.+)$
RewriteRule ^(.*)$ http://www.domain.com/index.php?/%1 [R=301,L]

RewriteRule ^/*(.*)$ http://www.domain.com/index/$1 [R=301,L]

The above results in a redirect loop. If I can at least get the URL to rewrite to a path with no question marks, I could then do individual redirects for the pages of the site.

Any help in getting rid of the question mark in this situation would be extremely appreciated.

--EDIT-- Ultimately, I will be redirecting from one website to another. The websites don't have the same naming conventions, so I imagine I'll use redirect 301 path newurl for the individual pages.

An example of the start to finish, I would need to redirect the following url:

http://www.domain.com/index.php?/About.html

to:

http://www.newsite.com/about.html

Not all of the old site names will be the same as you see About.html matching about.html, there will be urls with News.html going to /Blog-Folder/

What I imagine would be most efficient is getting the /index.php?/Page.html redirected to a folder path on the initial website so that it is set up like:

domain.com/index.php?/About.html -> domain.com/index/About.html -> newsite.com/about.html

Feel free to ask for more clarification if needed, I greatly appreciate any and all help.

Source Link
Loading