Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

My site for some reason is generating a shebang - /#!/splash-page on the URL. For example when I type www.modernvintage1005.com, the browser returns www.modernvintage1005.com/#!/splash-page and every subsequent page is /#!/about, /#!/contact, and so forth.

There's absolutely nothing on the Google about this. There is a lot of rewrite help to eliminate .index.php from the home page, but that's it.

How do I rewrite it to just say domain.com and domain.com/about.html, etc.?

Here is my .htaccess file if you need to see it.

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


</IfModule>

# compress text, html, javascript, css, xml:
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddType x-font/otf .otf
AddType x-font/ttf .ttf
AddType x-font/eot .eot
AddType x-font/woff .woff
AddType image/x-icon .ico
AddType image/png .png
</IfModule>

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>
## EXPIRES CACHING ##
share|improve this question
add comment

1 Answer

The "hashbang" or "shebang" url syntax is an old hack designed to provide browser history to AJAX sites and to help Google index content that is loaded via JavaScript. See "What's the shebang/hashbang (#!) in Facebook and new Twitter URLs for?" for more.

Your WordPress theme, "John Smith", is responsible for rewriting URLs in this way. It does this so that it can load each page using JavaScript without a full page refresh and still make the content accessible to Google's crawlers. (This is what the "AJAX" in the "AJAX Portfolio Theme" refers to.) It is nothing to do with your .htaccess file.

A lot of webmasters now feel that using the hashbang URL syntax is a bad idea for the reasons stayed here – it is not very future-proof, and there are now better options available. (i.e. "pushState", an HTML5 feature that allows developers to modify the browser URL without refreshing the page.)

Your options are to:

  • Contact the theme developer and ask them if there is an option to turn off the AJAX functionality in their theme to remove the hashbang URLs.
  • Contact the theme developer and ask them to consider modifying the theme to use pushState instead of location.hash. (Refer them to this article.) This would give you URLs with no hashbang, which sounds like what you want.
  • Use a different WordPress theme.
share|improve this answer
    
Thanks a lot for your response. I read up on this on another answer from another forum and there is a lot of common views. However, there is a chatter that the use of shebangs may actually be better for SEO than not to have them. If that is the case, I'd consider keeping them. What is your take on that? –  user32642 Nov 9 '13 at 23:21
    
Using pushState should not make sites any less crawlable. See this post from moz.com, who now recommend it over the #! hack. Just make sure that the URL you update with pushState loads identical content with JavaScript turned off. With WordPress, this is easy – you just need to make sure pretty permalinks are turned on. The only other consideration is that older browsers don't support pushState, but developers can use history.js to work around that. –  Nick Nov 9 '13 at 23:49
    
This was very helpful. Thank you. I'm on a mission now –  user32642 Nov 9 '13 at 23:59
    
By the way, I guess I need more reputation to vote your answer up. Sorry. I would if I could –  user32642 Nov 10 '13 at 0:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.